package com.jbp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jbp.dao.GiftDao;
import com.jbp.model.Gift;
import com.jbp.service.GiftService;
import org.springframework.stereotype.Service;
import com.jbp.utils.PageUtils;
import com.jbp.utils.Query;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 礼物(Gift)表服务实现类
 * @author cc
 * @since 2020-06-20 08:53:26
 */
@Service
public class GiftServiceImpl extends ServiceImpl<GiftDao, Gift> implements GiftService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<Gift> page = this.page(
                new Query<Gift>().getPage(params),
                new QueryWrapper<>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<Gift> distinctGiftList() {
        return baseMapper.distinctGiftList();
    }
}